<!-- 导航URL -->
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a>主页</a></li>
            <li><a>交易查询</a></li>
            <li class="active"><strong>交易预警</strong></li>
        </ol>
    </div>
</div>
<style type="text/css">
    .inputStyleMy {
        width:100px;margin:2px 0px 2px 0px;display:inline;
    }
    .textStyleMy {
        margin:7px 10px 7px 10px;display:inline;
    }
    .selectStyleMy {
        width:80px;margin:2px 0px 2px 0px;display:inline;
    }
</style>

<!-- 主要内容 -->
<div class="wrapper wrapper-content animated fadeIn" ng-app
     ng-controller="tradeWarningCtrl">
    <form class="form-horizontal" id="form1" name="horizontal" novalidate>
        <div class="row">
            <div class="col-lg-12">
                <div class="tabs-container tab_other">
                    <div class="panel-body ibox float-e-margins">
                        <!--交易错误预警-->
                        <div class="ibox-content">
                            <div class="form-group">
                                <h5 style="font-size:14px;">交易错误预警</h5>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">同一商户连续N次错误预警:</label>
                                <div class="col-sm-10 checkbox" ng-bind="info.content">
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>交易错误预警阈值设置:</label>
                                <div class="col-sm-10">
                                    <div id="tradeWarning">
                                        <div ng-repeat="(index,item) in tradeWarning" style="width: 100%;overflow: hidden; margin-bottom: 5px;">
                                            <input type="hidden" ng-model="item.id">
                                            <input type="text" class="inputStyleMy form-control"  ng-model="item.minute" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                            <span  class="textStyleMy"> 分钟 </span>
                                            <input type="text" class="inputStyleMy form-control" ng-model="item.num" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                            <span  class="textStyleMy"> 次 </span>
                                            <input type="text" class="inputStyleMy form-control" ng-model="item.errCode" required>
                                            <span  class="textStyleMy"> 错误 </span>
                                            <a ng-click="delrule(index,item)" style="line-height: 36px; margin-left: 10px;">删除规则</a>
                                        </div>
                                    </div>
                                    <a ng-click="addrule()" style="line-height: 36px; margin-left: 10px;">新建规则</a>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"></label>
                                <div class="col-sm-10">
                                    <span style="color:#999999;">备注:在设置的时间范围内,超时的商户总次数达到设置的次数,则会发送预警短信</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>预警缓冲时间设置:</label>
                                <div class="col-sm-10">
                                    <input type="text" class="inputStyleMy form-control" ng-model="info.cdTime" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span  class="textStyleMy">分钟</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"></label>
                                <div class="col-sm-10">
                                    <span style="color:#999999;">备注:触发预警后缓冲时间内不会发送短信,缓冲时间结束后重新记录预警事件</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>短信接收人:</label>
                                <div class="col-sm-10">
                                    <textarea style="width:400px;height:100px;" ng-model="info.phones" required></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"></label>
                                <div class="col-sm-10" >
                                    <span style="color: #999999;">注:若需多人同时接收短信时,请用英文逗号隔开</span>
                                </div>
                            </div>


                            <div class="form-group">
                                <h5 style="font-size:14px;">交易异常预警</h5>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">商户交易异常预警:</label>
                                <div class="col-sm-10 checkbox" ng-bind="infoB.content">
                                </div>
                            </div>
                            <!--刷卡交易异常预警阀值设置 -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>刷卡交易异常预警阀值设置:</label>
                                <div class="col-sm-10">
                                    <input type="text" class="inputStyleMy form-control" ng-model="tradeWarningMap.posTrade.minute" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span class="textStyleMy">分钟内，</span>
                                    <select class="selectStyleMy form-control" ng-model="tradeWarningMap.posTrade.countType" ng-options="x.value as x.text for x in typeList" required/>
                                    <span class="textStyleMy">接口网络超时数据达到</span>
                                    <input type="text" class="inputStyleMy form-control" ng-model="tradeWarningMap.posTrade.num" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span class="textStyleMy">条</span>
                                </div>
                            </div>

                            <!--扫码交易异常预警阀值设置 -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>扫码交易异常预警阀值设置:</label>
                                <div class="col-sm-10">
                                    <input type="text" class="inputStyleMy form-control" ng-model="tradeWarningMap.scanTrade.minute" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span class="textStyleMy">分钟内，</span>
                                    <select class="selectStyleMy form-control" ng-model="tradeWarningMap.scanTrade.timeoutCountType" ng-options="x.value as x.text for x in typeList" required/>
                                    <span class="textStyleMy">接口网络超时数据达到</span>
                                    <input type="text" class="inputStyleMy form-control" ng-model="tradeWarningMap.scanTrade.timeoutNum" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span class="textStyleMy">条 &nbsp;&nbsp;或&nbsp;&nbsp;</span>
                                    <select class="selectStyleMy form-control" ng-model="tradeWarningMap.scanTrade.waitCountType" ng-options="x.value as x.text for x in typeList" required/>
                                    <span class="textStyleMy">等待上游回调数据达到</span>
                                    <input type="text" class="inputStyleMy form-control" ng-model="tradeWarningMap.scanTrade.waitNum" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span class="textStyleMy">条</span>
                                </div>
                            </div>

                            <!--快捷交易异常预警阀值设置 -->
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>快捷交易异常预警阀值设置:</label>
                                <div class="col-sm-10">
                                    <input type="text" class="inputStyleMy form-control" ng-model="tradeWarningMap.fastTrade.minute" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span class="textStyleMy">分钟内，</span>
                                    <select class="selectStyleMy form-control" ng-model="tradeWarningMap.fastTrade.timeoutCountType" ng-options="x.value as x.text for x in typeList" required/>
                                    <span class="textStyleMy">接口网络超时数据达到</span>
                                    <input type="text" class="inputStyleMy form-control" ng-model="tradeWarningMap.fastTrade.timeoutNum" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span class="textStyleMy">条 &nbsp;&nbsp;或&nbsp;&nbsp;</span>
                                    <select class="selectStyleMy form-control" ng-model="tradeWarningMap.fastTrade.waitCountType" ng-options="x.value as x.text for x in typeList" required/>
                                    <span class="textStyleMy">等待上游回调数据达到</span>
                                    <input type="text" class="inputStyleMy form-control" ng-model="tradeWarningMap.fastTrade.waitNum" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span class="textStyleMy">条</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>预警缓冲时间设置:</label>
                                <div class="col-sm-10">
                                    <input type="text" class="inputStyleMy form-control" ng-model="infoB.cdTime" ng-pattern="/^(0|[1-9][0-9]*)$/" required>
                                    <span  class="textStyleMy">分钟</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"></label>
                                <div class="col-sm-10">
                                    <span style="color:#999999;">备注:触发预警后缓冲时间内不会发送短信,缓冲时间结束后重新记录预警事件</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><i class="red_req">*</i>短信接收人:</label>
                                <div class="col-sm-10">
                                    <textarea style="width:400px;height:100px;" ng-model="infoB.phones" required></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"></label>
                                <div class="col-sm-10" >
                                    <span style="color: #999999;">注:若需多人同时接收短信时,请用英文逗号隔开</span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-12 bgff">
            <div class="col-sm-3"></div>
            <div class="col-sm-6">
                <button class="btn btn-new btn-mr20" style="width: 130px;" type="button"
                        ng-click="updatetradeWarning()" ng-disabled="horizontal.$invalid ||submitting" id="btnSubmit">保存</button>
                <a class="btn btn-primary4 btn-mr20" style="width: 130px;" type="button" ui-sref="trade.tradeQuery">返回</a>
            </div>
        </div>
    </form>
</div>
